<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改地区交易量1')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-binding-editRoutRateType" >
        <input type="hidden" name="id" th:value="${routRateType.ID}">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否会员：</label>
            <div class="col-sm-8">
                <input name="type"   th:value="${routRateType.TYPE}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">开始：</label>
            <div class="col-sm-8">
                <input name="beginidx" th:value="${routRateType.BEGINIDX}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">结束：</label>
            <div class="col-sm-8">
                <input name="endidx" th:value="${routRateType.ENDIDX}"  class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">费率类型：</label>
            <div class="col-sm-8">
                <input name="proportion" onkeyup="value=value.replace(/[^\d]/g,'')" th:value="${routRateType.PROPORTION}"  class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">机具类型：</label>
            <div class="col-sm-8">
                <input name="isthird" oninput="value=value.replace(/[^\d]/g,'')" th:value="${routRateType.ISTHIRD}"   class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">前金额段：</label>
            <div class="col-sm-8">
                <input name="beginamt" oninput="value=value.replace(/[^\d]/g,'')" th:value="${routRateType.BEGINAMT}"   class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">后金额段：</label>
            <div class="col-sm-8">
                <input name="endamt" oninput="value=value.replace(/[^\d]/g,'')" th:value="${routRateType.ENDAMT}"   class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">生效前时间段：</label>
            <div class="input-group col-sm-8" style="margin-left: 202px">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input type="text" name="beginhour" class="form-control"  th:value="${routRateType.BEGINHOUR}"  id="laydate-demo-3" placeholder="HH:mm:ss" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">生效后时间段：</label>
            <div class="input-group col-sm-8" style="margin-left: 202px">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input type="text" name="endhour"  class="form-control" th:value="${routRateType.ENDHOUR}" id="laydate-demo-4" placeholder="HH:mm:ss" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">起始日期：</label>
            <div class="input-group col-sm-8" style="margin-left: 202px">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input name="begindate" class="form-control time-input"  th:value="${routRateType.BEGINDATE}" placeholder="yyyy-MM-dd" id="laydate-demo-1" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">结束日期：</label>
            <div class="input-group col-sm-8" style="margin-left: 202px">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input name="enddate" class="form-control time-input" th:value="${routRateType.ENDDATE}"  placeholder="yyyy-MM-dd" id="laydate-demo-2" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">新用户标准：</label>
            <div class="col-sm-8">
                <input name="newpro" th:value="${routRateType.NEWPRO}"   class="form-control" type="text" required>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "tBankinfo/tBankinfo";
    $("#form-binding-editRoutRateType").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/editSaveRoutRateType", $('#form-binding-editRoutRateType').serialize());
        }
    }

    $(function(){
        <!-- laydate示例 -->
        layui.use('laydate', function() {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#laydate-demo-1',
                type: 'date',
                trigger: 'click'
            });
            laydate.render({
                elem: '#laydate-demo-2',
                type: 'date',
                trigger: 'click'
            });
            laydate.render({
                elem: '#laydate-demo-3',
                type: 'time',
                trigger: 'click'
            });
            laydate.render({
                elem: '#laydate-demo-4',
                type: 'time',
                trigger: 'click'
            });
            laydate.render({
                elem: '#laydate-demo-5',
                type: 'date',
                trigger: 'click'
            });

            var startDate = laydate.render({
                elem: '#laydate-startTime',
                max: $('#laydate-endTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function(value, date) {
                    // 结束时间大于开始时间
                    if (value !== '') {
                        endDate.config.min.year = date.year;
                        endDate.config.min.month = date.month - 1;
                        endDate.config.min.date = date.date;
                    } else {
                        endDate.config.min.year = '';
                        endDate.config.min.month = '';
                        endDate.config.min.date = '';
                    }
                }
            });

            var endDate = laydate.render({
                elem: '#laydate-endTime',
                min: $('#laydate-startTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function(value, date) {
                    // 开始时间小于结束时间
                    if (value !== '') {
                        startDate.config.max.year = date.year;
                        startDate.config.max.month = date.month - 1;
                        startDate.config.max.date = date.date;
                    } else {
                        startDate.config.max.year = '';
                        startDate.config.max.month = '';
                        startDate.config.max.date = '';
                    }
                }
            });
        });

    });
</script>
</body>
</html>